```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统问题排查专家指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            line-height: 1.8;
            color: #333;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 8px;
            position: relative;
        }
        .code-header {
            background-color: #1e1e1e;
            padding: 8px 16px;
            border-top-left-radius: 8px;
            border-top-right-radius: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .code-content {
            padding: 16px;
            overflow-x: auto;
        }
        .command-icon {
            color: #a777e3;
            margin-right: 8px;
        }
        .table-container {
            overflow-x: auto;
        }
        .tooltip {
            position: relative;
            display: inline-block;
        }
        .tooltip .tooltip-text {
            visibility: hidden;
            width: 200px;
            background-color: #555;
            color: #fff;
            text-align: center;
            border-radius: 6px;
            padding: 5px;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            margin-left: -100px;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6">系统问题排查专家指南</h1>
                    <p class="text-xl mb-8 opacity-90">五把金钥匙解锁系统疑难杂症，打造高效运维体系</p>
                    <div class="flex space-x-4">
                        <a href="#section-1" class="bg-white text-purple-600 hover:bg-gray-100 px-6 py-3 rounded-lg font-medium transition duration-300">开始探索</a>
                        <a href="#section-7" class="bg-transparent border-2 border-white hover:bg-white hover:bg-opacity-10 px-6 py-3 rounded-lg font-medium transition duration-300">自动化方案</a>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="relative w-full max-w-md">
                        <div class="absolute inset-0 bg-white opacity-10 rounded-xl transform rotate-6"></div>
                        <div class="relative bg-white bg-opacity-10 backdrop-filter backdrop-blur-sm rounded-xl p-6 border border-white border-opacity-20">
                            <div class="flex items-center mb-4">
                                <div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <div class="code-block">
                                <div class="code-header">
                                    <span class="text-gray-400">bash</span>
                                    <button class="text-gray-400 hover:text-white">
                                        <i class="far fa-copy"></i>
                                    </button>
                                </div>
                                <div class="code-content">
                                    <pre class="m-0"><code># 黄金五连击
$ top -c -n 1
$ dmesg | tail -20
$ journalctl -xe -n 50
$ netstat -tulnp
$ df -hT</code></pre>
                                </div>
                            </div>
                            <div class="mt-4 text-sm opacity-80">立即获取系统健康状况快照</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Navigation -->
    <nav class="bg-white shadow-sm sticky top-0 z-10">
        <div class="container mx-auto max-w-6xl">
            <div class="flex justify-center space-x-1 md:space-x-8 py-4 overflow-x-auto">
                <a href="#section-1" class="px-4 py-2 text-purple-600 font-medium hover:bg-purple-50 rounded-md">快速定位</a>
                <a href="#section-2" class="px-4 py-2 text-gray-600 hover:text-purple-600 font-medium hover:bg-purple-50 rounded-md">日志分析</a>
                <a href="#section-3" class="px-4 py-2 text-gray-600 hover:text-purple-600 font-medium hover:bg-purple-50 rounded-md">性能分析</a>
                <a href="#section-4" class="px-4 py-2 text-gray-600 hover:text-purple-600 font-medium hover:bg-purple-50 rounded-md">网络诊断</a>
                <a href="#section-5" class="px-4 py-2 text-gray-600 hover:text-purple-600 font-medium hover:bg-purple-50 rounded-md">存储问题</a>
                <a href="#section-6" class="px-4 py-2 text-gray-600 hover:text-purple-600 font-medium hover:bg-purple-50 rounded-md">实战案例</a>
                <a href="#section-7" class="px-4 py-2 text-gray-600 hover:text-purple-600 font-medium hover:bg-purple-50 rounded-md">自动化体系</a>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main class="container mx-auto max-w-6xl py-12 px-4">
        <!-- Section 1 -->
        <section id="section-1" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 text-purple-600 rounded-full w-12 h-12 flex items-center justify-center mr-4">
                    <span class="text-xl font-bold">1</span>
                </div>
                <h2 class="text-3xl font-bold">快速定位问题的五把金钥匙</h2>
            </div>

            <div class="grid md:grid-cols-2 gap-8">
                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-bolt command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">系统状态速查表</h3>
                        </div>
                        <p class="text-gray-600 mb-4">快速获取系统关键指标的黄金五连击命令：</p>
                        <div class="code-block mb-4">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code># 黄金五连击
$ top -c -n 1          # 实时进程监控
$ dmesg | tail -20     # 最近内核日志
$ journalctl -xe -n 50 # 系统日志最后50条
$ netstat -tulnp       # 端口占用情况
$ df -hT               # 磁盘空间检查</code></pre>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fab fa-java command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">Java专用检测工具</h3>
                        </div>
                        <p class="text-gray-600 mb-4">针对Java应用的专用诊断命令：</p>
                        <div class="code-block mb-4">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code># 查看JVM状态
$ jps -mlv             # 列出所有Java进程
$ jstat -gcutil <PID>  # 内存GC情况
$ jstack <PID>         # 线程堆栈快照</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="mt-8 card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-fire command-icon text-2xl"></i>
                        <h3 class="text-xl font-bold">实战案例：Spring Boot应用启动失败</h3>
                    </div>
                    <p class="text-gray-600 mb-4">现象：端口8080被占用</p>
                    <div class="code-block mb-4">
                        <div class="code-header">
                            <span class="text-gray-400">bash</span>
                            <button class="text-gray-400 hover:text-white">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <div class="code-content">
                            <pre class="m-0"><code>$ netstat -tulnp | grep 8080
tcp6   0   0 :::8080   :::*    LISTEN   1234/java

$ ps -fp 1234
UID        PID  PPID  C STIME TTY      TIME CMD
user     1234     1  0 10:00 ?      00:00:15 /usr/lib/jvm/java-11-openjdk/bin/java -jar old_app.jar

$ sudo kill 1234  # 终止旧进程
$ nohup java -jar new_app.jar &  # 重启应用</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Section 2 -->
        <section id="section-2" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 text-purple-600 rounded-full w-12 h-12 flex items-center justify-center mr-4">
                    <span class="text-xl font-bold">2</span>
                </div>
                <h2 class="text-3xl font-bold">日志分析的三大神器</h2>
            </div>

            <div class="grid md:grid-cols-2 gap-8">
                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-search command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">日志查看技巧</h3>
                        </div>
                        <div class="table-container">
                            <table class="min-w-full divide-y divide-gray-200">
                                <thead class="bg-gray-50">
                                    <tr>
                                        <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">命令</th>
                                        <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">功能说明</th>
                                        <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Java应用场景</th>
                                    </tr>
                                </thead>
                                <tbody class="bg-white divide-y divide-gray-200">
                                    <tr>
                                        <td class="px-4 py-3 whitespace-nowrap text-sm font-mono text-purple-600">grep -C 5</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">显示匹配行前后5行</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">查找异常上下文</td>
                                    </tr>
                                    <tr>
                                        <td class="px-4 py-3 whitespace-nowrap text-sm font-mono text-purple-600">tail -f</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">实时追踪日志</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">监控应用启动过程</td>
                                    </tr>
                                    <tr>
                                        <td class="px-4 py-3 whitespace-nowrap text-sm font-mono text-purple-600">zgrep</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">搜索压缩日志</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">分析历史日志归档</td>
                                    </tr>
                                    <tr>
                                        <td class="px-4 py-3 whitespace-nowrap text-sm font-mono text-purple-600">multiline-grep</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">多行匹配</td>
                                        <td class="px-4 py-3 text-sm text-gray-600">分析Java堆栈跟踪</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-server command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">ELK日志分析平台搭建</h3>
                        </div>
                        <div class="code-block mb-4">
                            <div class="code-header">
                                <span class="text-gray-400">docker-compose.yml</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code>version: '3'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.15.0
    environment:
      - discovery.type=single-node
  kibana:
    image: docker.elastic.co/kibana/kibana:7.15.0
    ports:
      - "5601:5601"
  logstash:
    image: docker.elastic.co/logstash/logstash:7.15.0
    volumes:
      - ./logstash.conf:/usr/share/logstash/pipeline/logstash.conf</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="mt-8 card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-cog command-icon text-2xl"></i>
                        <h3 class="text-xl font-bold">Logstash配置示例（解析Java日志）</h3>
                    </div>
                    <div class="code-block">
                        <div class="code-header">
                            <span class="text-gray-400">logstash.conf</span>
                            <button class="text-gray-400 hover:text-white">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <div class="code-content">
                            <pre class="m-0"><code>input {
  file {
    path => "/var/log/java-app/*.log"
    codec => multiline {
      pattern => "^%{TIMESTAMP_ISO8601} "
      negate => true
      what => previous
    }
  }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Section 3 -->
        <section id="section-3" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 text-purple-600 rounded-full w-12 h-12 flex items-center justify-center mr-4">
                    <span class="text-xl font-bold">3</span>
                </div>
                <h2 class="text-3xl font-bold">性能问题的四维分析法</h2>
            </div>

            <div class="grid md:grid-cols-2 gap-8">
                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-microchip command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">CPU性能瓶颈排查</h3>
                        </div>
                        <p class="text-gray-600 mb-4">使用火焰图分析CPU热点：</p>
                        <div class="code-block mb-4">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code># 火焰图生成（需安装perf和FlameGraph）
$ perf record -F 99 -p <PID> -g -- sleep 30
$ perf script | stackcollapse-perf.pl | flamegraph.pl > flame.svg</code></pre>
                            </div>
                        </div>
                        <div class="flex items-center text-sm text-gray-500">
                            <i class="fas fa-info-circle mr-2"></i>
                            <span>火焰图可以直观显示CPU时间消耗在哪些函数</span>
                        </div>
                    </div>
                </div>

                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-memory command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">内存泄漏定位</h3>
                        </div>
                        <p class="text-gray-600 mb-4">生成和分析Java堆内存dump：</p>
                        <div class="code-block mb-4">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code># 生成内存dump（JDK自带）
$ jmap -dump:live,format=b,file=heap.hprof <PID>

# 分析工具推荐：
1. Eclipse MAT
2. VisualVM
3. YourKit</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="mt-8 card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-project-diagram command-icon text-2xl"></i>
                        <h3 class="text-xl font-bold">实战案例：微服务内存泄漏</h3>
                    </div>
                    <p class="text-gray-600 mb-4">现象：Pod频繁重启</p>
                    <div class="mb-4">
                        <div class="code-block">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code>$ kubectl top pod  # 发现内存持续增长
$ jmap -histo:live <PID>  # 查看对象分布
# 发现自定义缓存未设置上限
# 使用Guava Cache重写并设置最大条目</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Section 4 -->
        <section id="section-4" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 text-purple-600 rounded-full w-12 h-12 flex items-center justify-center mr-4">
                    <span class="text-xl font-bold">4</span>
                </div>
                <h2 class="text-3xl font-bold">网络问题的六步诊断法</h2>
            </div>

            <div class="grid md:grid-cols-2 gap-8">
                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-network-wired command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">网络排查工具链</h3>
                        </div>
                        <div class="code-block mb-4">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code># 从应用到网络的排查路径
$ telnet localhost 8080          # 端口本地可达性
$ curl -v http://localhost:8080  # HTTP协议检测
$ tcpdump -i eth0 port 8080 -w capture.pcap  # 抓包分析
$ traceroute 8.8.8.8             # 路由追踪
$ mtr 8.8.8.8                    # 持续路由诊断
$ nslookup api.example.com       # DNS解析检查</code></pre>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fab fa-java command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">Java网络编程常见问题</h3>
                        </div>
                        <ul class="list-disc pl-5 text-gray-600 mb-4">
                            <li class="mb-2">Socket未关闭导致文件描述符耗尽</li>
                            <li class="mb-2">DNS缓存未及时刷新</li>
                            <li class="mb-2">连接池配置不当</li>
                            <li>未处理TCP Keep-Alive</li>
                        </ul>
                        <div class="code-block">
                            <div class="code-header">
                                <span class="text-gray-400">java</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code>// 正确关闭资源示例
try (Socket socket = new Socket(host, port);
     OutputStream out = socket.getOutputStream()) {
    // 业务逻辑
} // 自动关闭资源</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Section 5 -->
        <section id="section-5" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 text-purple-600 rounded-full w-12 h-12 flex items-center justify-center mr-4">
                    <span class="text-xl font-bold">5</span>
                </div>
                <h2 class="text-3xl font-bold">存储问题的三重境界</h2>
            </div>

            <div class="grid md:grid-cols-2 gap-8">
                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-hdd command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">磁盘IO问题定位</h3>
                        </div>
                        <div class="code-block mb-4">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code># 使用iotop定位高IO进程
$ iotop -oPa

# 查看文件打开情况
$ lsof -p <PID> | grep deleted  # 查找未释放的文件

# 文件系统检查
$ smartctl -a /dev/sda         # 硬盘健康检测</code></pre>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-file-alt command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">文件描述符泄漏排查</h3>
                        </div>
                        <div class="code-block">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code># 查看进程文件描述符
$ ls -l /proc/<PID>/fd | wc -l

# 设置全局限制
echo "* soft nofile 65535" >> /etc/security/limits.conf</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Section 6 -->
        <section id="section-6" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 text-purple-600 rounded-full w-12 h-12 flex items-center justify-center mr-4">
                    <span class="text-xl font-bold">6</span>
                </div>
                <h2 class="text-3xl font-bold">综合实战：电商大促故障排查</h2>
            </div>

            <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300 mb-8">
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-exclamation-triangle command-icon text-2xl"></i>
                        <h3 class="text-xl font-bold">故障现象</h3>
                    </div>
                    <ul class="list-disc pl-5 text-gray-600">
                        <li class="mb-2">用户下单延迟高达15秒</li>
                        <li class="mb-2">Nginx出现502错误</li>
                        <li>数据库CPU飙升</li>
                    </ul>
                </div>
            </div>

            <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300 mb-8">
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-search command-icon text-2xl"></i>
                        <h3 class="text-xl font-bold">排查过程</h3>
                    </div>
                    <h4 class="font-bold text-lg mb-2">步骤1：快速定位瓶颈点</h4>
                    <div class="code-block mb-4">
                        <div class="code-header">
                            <span class="text-gray-400">bash</span>
                            <button class="text-gray-400 hover:text-white">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <div class="code-content">
                            <pre class="m-0"><code>$ top
%Cpu(s): 80.3 us, 15.2 sy   # 用户态CPU高 -> Java应用问题
$ jstack <PID> | grep BLOCKED -A 30  # 发现数据库连接池竞争</code></pre>
                        </div>
                    </div>

                    <h4 class="font-bold text-lg mb-2 mt-6">步骤2：数据库分析</h4>
                    <div class="code-block mb-4">
                        <div class="code-header">
                            <span class="text-gray-400">sql</span>
                            <button class="text-gray-400 hover:text-white">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <div class="code-content">
                            <pre class="m-0"><code>SHOW PROCESSLIST;  -- 发现大量State='Sending data'
EXPLAIN SELECT ... -- 发现未使用索引</code></pre>
                        </div>
                    </div>

                    <h4 class="font-bold text-lg mb-2 mt-6">步骤3：网络层验证</h4>
                    <div class="code-block">
                        <div class="code-header">
                            <span class="text-gray-400">bash</span>
                            <button class="text-gray-400 hover:text-white">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <div class="code-content">
                            <pre class="m-0"><code>$ tcpretrans -c 10  # 检测TCP重传率高达30%
$ ethtool -S eth0   # 发现rx_missed_errors增长</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-check-circle command-icon text-2xl"></i>
                        <h3 class="text-xl font-bold">最终解决方案</h3>
                    </div>
                    <ol class="list-decimal pl-5 text-gray-600 mb-4">
                        <li class="mb-2">为慢查询添加复合索引</li>
                        <li class="mb-2">调整数据库连接池配置（HikariCP）</li>
                        <li>优化网卡中断平衡</li>
                    </ol>
                    <div class="code-block">
                        <div class="code-header">
                            <span class="text-gray-400">java</span>
                            <button class="text-gray-400 hover:text-white">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <div class="code-content">
                            <pre class="m-0"><code>HikariConfig config = new HikariConfig();
config.setMaximumPoolSize(50);  // 原配置200
config.setConnectionTimeout(30000);</code></pre>
                        </div>
                    </div>
                    <div class="code-block mt-4">
                        <div class="code-header">
                            <span class="text-gray-400">bash</span>
                            <button class="text-gray-400 hover:text-white">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <div class="code-content">
                            <pre class="m-0"><code>$ sudo ethtool -L eth0 combined 8  # 启用多队列</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Section 7 -->
        <section id="section-7" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-purple-100 text-purple-600 rounded-full w-12 h-12 flex items-center justify-center mr-4">
                    <span class="text-xl font-bold">7</span>
                </div>
                <h2 class="text-3xl font-bold">构建自动化排查体系</h2>
            </div>

            <div class="grid md:grid-cols-2 gap-8">
                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-robot command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">故障自愈系统设计</h3>
                        </div>
                        <p class="text-gray-600 mb-4">监控脚本示例（检测OOM自动重启）：</p>
                        <div class="code-block">
                            <div class="code-header">
                                <span class="text-gray-400">python</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code>import subprocess
import re

def check_oom():
    logs = subprocess.check_output("dmesg -T | grep -i 'oom'", shell=True)
    if re.search(b'java', logs):
        restart_service()

def restart_service():
    subprocess.run("systemctl restart java-app", shell=True)</code></pre>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="card bg-white rounded-xl shadow-md overflow-hidden transition duration-300">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-brain command-icon text-2xl"></i>
                            <h3 class="text-xl font-bold">智能日志分析系统</h3>
                        </div>
                        <p class="text-gray-600 mb-4">使用机器学习分析日志模式：</p>
                        <div class="code-block">
                            <div class="code-header">
                                <span class="text-gray-400">bash</span>
                                <button class="text-gray-400 hover:text-white">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <div class="code-content">
                                <pre class="m-0"><code>$ logreduce -d /var/log/java-app analyze error.log</code></pre>
                            </div>
                        </div>
                        <div class="mt-4">
                            <div class="mermaid">
                                graph TD
                                    A[原始日志] --> B[日志收集]
                                    B --> C[日志解析]
                                    C --> D[特征提取]
                                    D --> E[异常检测]
                                    E --> F[告警通知]
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8">
        <div class="container mx-auto max-w-6xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                    <p class="text-gray-400 mt-1">专业的系统问题排查指南</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300">
                        <i class="fas fa-external-link-alt mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'dark',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });

        // Smooth scrolling
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });

        // Copy code blocks
        document.querySelectorAll('.code-header button').forEach(button => {
            button.addEventListener('click', function() {
                const codeBlock = this.parentNode.parentNode.querySelector('code');
                const textArea = document.createElement('textarea');
                textArea.value = codeBlock.textContent;
                document.body.appendChild(textArea);
                textArea.select();
                document.execCommand('copy');
                document.body.removeChild(textArea);
                
                // Show copied feedback
                const originalIcon = this.innerHTML;
                this.innerHTML = '<i class="fas fa-check"></i>';
                setTimeout(() => {
                    this.innerHTML = originalIcon;
                }, 2000);
            });
        });
    </script>
</body>
</html>
```